import Vue from 'vue';
import Router from 'vue-router';

import CheckCombineFile from '@views/common/CheckCombineFile';
import ErrorPage from '@views/common/ErrorPage';

import BilinMiniRedirect from '@views/common/BilinMiniRedirect';
// 测试用地址
import SetCookie from '@views/common/SetCookie';

import { basePath } from '@router/config';

Vue.use(Router);

// 处理老系统已存在的桌码和已配置的公众号链接，进行跳转到新的路径

const router = new Router({
    mode: 'history',
    // base: '/',
    routes: [
        // 浏览器做测试用设置必要信息地址
        {
            path: `${basePath}/set-cookie`,
            name: 'setCookie',
            component: SetCookie,
        },
        {
            path: `${basePath}/combine/:sgId/:checkFileName`,
            name: 'checkCombineFile',
            component: CheckCombineFile,
        },
        {
            path: `${basePath}/error`,
            name: 'errorPage',
            component: ErrorPage,
        },
        // 公版小程序
        {
            path: `${basePath}/bilin-mini-redirect`,
            name: 'bilinMiniRedirect',
            component: BilinMiniRedirect,
        },
    ],
});

export default router;
